{set:$siteConfig=new Config("site_config");}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{echo:$siteConfig->name}</title>
<link rel="stylesheet" href="{skin:css/index.css}" />
{js:jquery}
{js:form}
{js:validate}
{js:dialog}
</head>
</head>
<body class="second">
<div class="container_2">
	<div class="header">
		<h1 class="logo"><a title="{echo:$siteConfig->name}" href="{url:}">{echo:$siteConfig->name}</a></h1>
	</div>

{set:$id=intval(IReq::get('id'));}
	<div class="wrapper clearfix">
		<div class="gray_box_2 showbox_s clearfix">
			<ul id="piclist" class="piclist_2 clearfix">
			{query:name=goods_photo_relation AS a join=left join goods_photo AS b ON a.photo_id eq b.id where=a.goods_id eq $id order=a.id DESC fields=a.*,b.img }
				<li><a href="javascript:void(0);"><img  onclick="pic_show(this);" class="small_img" big_src="{webroot:}{$item['img']}" src="{echo:Thumb::get($item['img'],66,66);}" width="66" height="66" /></a></li>
			{/query}
			</ul>
			<a class="last" href="javascript:void(0);" onclick="pic_pre();"><span>上一个</span></a>
			<a class="next" href="javascript:void(0);" onclick="pic_next();"><span>下一个</span></a>
		</div>
	</div>
	<div class="showbox f14 m_10">
		{query:name=goods where=id eq $id limit=1}
		<h2><a href="{url:/site/products/id/$id/}">{$item['name']}</a></h2>

{set:$seo_data=array();}
{set:$seo_data['title']="查看大图_".$item['name'].'_'.$siteConfig->name }
{set:seo::set($seo_data);}

		{/query}
		<p><a href="javascript:void(0);" onclick="pic_pre();">上一页</a><span id="view_info"></span><a href="javascript:void(0);" onclick="pic_next();">下一页</a><a href="{url:}">返回首页</a></p>
		<input class="submit_buy m_10" type="button" value="立即购买" onclick="window.location='{url:/site/products/id/$id}';" />
	</div>
	<div class="showbox clearfix">
		<a class="last" href="javascript:void(0);" onclick="pic_pre();"><span>上一个</span></a>
		<a class="next" href="javascript:void(0);" onclick="pic_next();"><span>下一个</span></a>
		<div id="big_img" onclick="pic_next();" style="cursor:pointer"></div>
	</div>

<script type="text/javascript" src="{theme:javascript/pic_zoom.js}"></script>
<script language="javascript">
$(document).ready(function(){ script_init();pic_next(); });
function script_init()
{
	$(".small_img").each(function(i)
	{
		var image=new Array();
		image[i]=new Image();
		image.src=$(this).attr("big_src");
	});
}

var pic_now=0;
var total=$(".small_img").length;
function pic_next()
{
	if($("#piclist li").length==0)
		return;

	var e=$("#piclist").children(".current");

	if(e.length==0)
	{
		$("#piclist li img:first").click();
	}
	else
	{
		if( $(e[0]).next("li").length==0   )
		{
			$("#piclist li img:first").click();
		}
		else
		{
			$(e[0]).next("li").find("img").click();
		}
	}
}
function pic_pre()
{
	if($("#piclist li").length==0)
		return;

	var e=$("#piclist").children(".current");

	if(e.length==0)
	{
		$("#piclist li img:first").click();
	}
	else
	{
		if( $(e[0]).prev("li").length==0   )
		{
			$("#piclist li img:last").click();
		}
		else
		{
			$(e[0]).prev("li").find("img").click();
		}
	}
}

function pic_show(thiz)
{
	$(thiz).parents("ul").find("li").removeClass("current");
	$(thiz).parent("a").parent("li").addClass("current");
	//var e=$("#big_img")[0];
	var e = new Image;
	e.src=$(thiz).attr("big_src");
	img_load=function(){
		var width = parseInt(e.width);
		var height = parseInt(e.height);
		if(width>900)
		{
			e.width=910;
			e.height=parseInt(910*height/width);
		}
		$("#big_img").html("");
		$("#big_img").append($(e));
	};
	if(e.complete)
	{
		img_load();
	}
	else
	{
		$(e).load(img_load);
	}

	var position=$(thiz).parent("a").parent("li").prev("li").length+1;
	$("#view_info").html(position+"/"+total+"页");
}
</script>

	<div class="footer">
		{echo:$siteConfig->site_footer_code}
	</div>
</div>
</body>
</html>

